Currently, batteries in most of electronic devices are connected with external power adapters via charging interfaces of the electronic devices to realize charging. In order to reduce charging time during charging the battery, the charging current can be enhanced for realizing a quick charging on the battery in the related art. However, if an anomaly occurs in a charging loop, for example, an output voltage of the power adapter is an over-voltage and/or an output current of the power adapter is an over-current, the battery will be damaged, no matter whether the battery is charged in a conventional constant voltage mode or with increased charging current. Therefore, the anomaly in the charging loop cannot be detected and handled in the related art, such that the safety during the charging is poor.